package cx.zan.service;

import cx.zan.dao.CategoryDao;
import cx.zan.domain.Category;

import java.util.List;

/**
 * 分类
 * @author Mxb
 * @version 1.0
 * @date 2020/4/1 9:22
 */
public class CategoryService {
    private CategoryDao categoryDao = new CategoryDao();

    /**
     * 查询所有分类
     * @return
     */
    public List<Category> findAll(){
        List<Category> list = categoryDao.findAll();
        return list;
    }

    public void delete(String cid) {
        categoryDao.delete(cid);
    }

    public Category findById(String cid) {
        return categoryDao.findById(cid);
    }

    public void insert(Category category) {
        categoryDao.insert(category);
    }

    public void update(Category category) {

        categoryDao.update(category);
    }
}
